package com.eaoa.vo.pub.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the PUB_ACCOUNT table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="PUB_ACCOUNT"
 */

public abstract class BasePubAccount  implements Serializable {

	public static String REF = "PubAccount";
	public static String PROP_ACCOUNTNO = "accountno";
	public static String PROP_FAXPHONE = "faxphone";
	public static String PROP_EMPLOYEE_TYPE = "employeeType";
	public static String PROP_ISFIRSTLOGON = "isfirstlogon";
	public static String PROP_TELEPHONE = "telephone";
	public static String PROP_MOBILEPHONE = "mobilephone";
	public static String PROP_PASSWORD = "password";
	public static String PROP_CREATEBY = "createby";
	public static String PROP_PASSWORDERRORSCOUNT = "passworderrorscount";
	public static String PROP_CREATENAME = "createname";
	public static String PROP_CREATEDATE = "createdate";
	public static String PROP_ACCOUNTTYPE = "accounttype";
	public static String PROP_NAME = "name";
	public static String PROP_EMAIL = "email";
	public static String PROP_USERNAME = "username";
	public static String PROP_ISLOCK = "islock";
	public static String PROP_SESSIONID = "sessionid";
	public static String PROP_LOGINDATE = "logindate";
	public static String PROP_COMPANY = "company";


	// constructors
	public BasePubAccount () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BasePubAccount (java.lang.Long accountno) {
		this.setAccountno(accountno);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BasePubAccount (
		java.lang.Long accountno,
		com.eaoa.vo.pub.PubCustomer company,
		java.lang.String username) {

		this.setAccountno(accountno);
		this.setCompany(company);
		this.setUsername(username);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Long accountno;

	// fields
	private java.lang.String username;
	private java.lang.String password;
	private java.lang.String name;
	private java.lang.String email;
	private java.lang.String telephone;
	private java.lang.String faxphone;
	private java.lang.String mobilephone;
	private java.lang.String islock;
	private java.lang.Long employeeType;
	private java.lang.String accounttype;
	private java.lang.String sessionid;
	private java.util.Date logindate;
	private java.lang.Long createby;
	private java.lang.String createname;
	private java.util.Date createdate;
	private java.lang.Long passworderrorscount;
	private java.lang.String isfirstlogon;

	// many to one
	private com.eaoa.vo.pub.PubCustomer company;

	// collections
	private java.util.Set<com.eaoa.vo.pub.PubCustomer> pubCustomers;
	private java.util.Set<com.eaoa.vo.pub.PubRole> pubRoles;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="increment"
     *  column="ACCOUNTNO"
     */
	public java.lang.Long getAccountno () {
		return accountno;
	}

	/**
	 * Set the unique identifier of this class
	 * @param accountno the new ID
	 */
	public void setAccountno (java.lang.Long accountno) {
		this.accountno = accountno;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: USERNAME
	 */
	public java.lang.String getUsername () {
		return username;
	}

	/**
	 * Set the value related to the column: USERNAME
	 * @param username the USERNAME value
	 */
	public void setUsername (java.lang.String username) {
		this.username = username;
	}



	/**
	 * Return the value associated with the column: PASSWORD
	 */
	public java.lang.String getPassword () {
		return password;
	}

	/**
	 * Set the value related to the column: PASSWORD
	 * @param password the PASSWORD value
	 */
	public void setPassword (java.lang.String password) {
		this.password = password;
	}



	/**
	 * Return the value associated with the column: NAME
	 */
	public java.lang.String getName () {
		return name;
	}

	/**
	 * Set the value related to the column: NAME
	 * @param name the NAME value
	 */
	public void setName (java.lang.String name) {
		this.name = name;
	}



	/**
	 * Return the value associated with the column: EMAIL
	 */
	public java.lang.String getEmail () {
		return email;
	}

	/**
	 * Set the value related to the column: EMAIL
	 * @param email the EMAIL value
	 */
	public void setEmail (java.lang.String email) {
		this.email = email;
	}



	/**
	 * Return the value associated with the column: TELEPHONE
	 */
	public java.lang.String getTelephone () {
		return telephone;
	}

	/**
	 * Set the value related to the column: TELEPHONE
	 * @param telephone the TELEPHONE value
	 */
	public void setTelephone (java.lang.String telephone) {
		this.telephone = telephone;
	}



	/**
	 * Return the value associated with the column: FAXPHONE
	 */
	public java.lang.String getFaxphone () {
		return faxphone;
	}

	/**
	 * Set the value related to the column: FAXPHONE
	 * @param faxphone the FAXPHONE value
	 */
	public void setFaxphone (java.lang.String faxphone) {
		this.faxphone = faxphone;
	}



	/**
	 * Return the value associated with the column: MOBILEPHONE
	 */
	public java.lang.String getMobilephone () {
		return mobilephone;
	}

	/**
	 * Set the value related to the column: MOBILEPHONE
	 * @param mobilephone the MOBILEPHONE value
	 */
	public void setMobilephone (java.lang.String mobilephone) {
		this.mobilephone = mobilephone;
	}



	/**
	 * Return the value associated with the column: ISLOCK
	 */
	public java.lang.String getIslock () {
		return islock;
	}

	/**
	 * Set the value related to the column: ISLOCK
	 * @param islock the ISLOCK value
	 */
	public void setIslock (java.lang.String islock) {
		this.islock = islock;
	}



	/**
	 * Return the value associated with the column: EMPLOYEETYPE
	 */
	public java.lang.Long getEmployeeType () {
		return employeeType;
	}

	/**
	 * Set the value related to the column: EMPLOYEETYPE
	 * @param employeeType the EMPLOYEETYPE value
	 */
	public void setEmployeeType (java.lang.Long employeeType) {
		this.employeeType = employeeType;
	}



	/**
	 * Return the value associated with the column: ACCOUNTTYPE
	 */
	public java.lang.String getAccounttype () {
		return accounttype;
	}

	/**
	 * Set the value related to the column: ACCOUNTTYPE
	 * @param accounttype the ACCOUNTTYPE value
	 */
	public void setAccounttype (java.lang.String accounttype) {
		this.accounttype = accounttype;
	}



	/**
	 * Return the value associated with the column: SESSIONID
	 */
	public java.lang.String getSessionid () {
		return sessionid;
	}

	/**
	 * Set the value related to the column: SESSIONID
	 * @param sessionid the SESSIONID value
	 */
	public void setSessionid (java.lang.String sessionid) {
		this.sessionid = sessionid;
	}



	/**
	 * Return the value associated with the column: LOGINDATE
	 */
	public java.util.Date getLogindate () {
		return logindate;
	}

	/**
	 * Set the value related to the column: LOGINDATE
	 * @param logindate the LOGINDATE value
	 */
	public void setLogindate (java.util.Date logindate) {
		this.logindate = logindate;
	}



	/**
	 * Return the value associated with the column: CREATEBY
	 */
	public java.lang.Long getCreateby () {
		return createby;
	}

	/**
	 * Set the value related to the column: CREATEBY
	 * @param createby the CREATEBY value
	 */
	public void setCreateby (java.lang.Long createby) {
		this.createby = createby;
	}



	/**
	 * Return the value associated with the column: CREATENAME
	 */
	public java.lang.String getCreatename () {
		return createname;
	}

	/**
	 * Set the value related to the column: CREATENAME
	 * @param createname the CREATENAME value
	 */
	public void setCreatename (java.lang.String createname) {
		this.createname = createname;
	}



	/**
	 * Return the value associated with the column: CREATEDATE
	 */
	public java.util.Date getCreatedate () {
		return createdate;
	}

	/**
	 * Set the value related to the column: CREATEDATE
	 * @param createdate the CREATEDATE value
	 */
	public void setCreatedate (java.util.Date createdate) {
		this.createdate = createdate;
	}



	/**
	 * Return the value associated with the column: PASSWORDERRORSCOUNT
	 */
	public java.lang.Long getPassworderrorscount () {
		return passworderrorscount;
	}

	/**
	 * Set the value related to the column: PASSWORDERRORSCOUNT
	 * @param passworderrorscount the PASSWORDERRORSCOUNT value
	 */
	public void setPassworderrorscount (java.lang.Long passworderrorscount) {
		this.passworderrorscount = passworderrorscount;
	}



	/**
	 * Return the value associated with the column: ISFIRSTLOGON
	 */
	public java.lang.String getIsfirstlogon () {
		return isfirstlogon;
	}

	/**
	 * Set the value related to the column: ISFIRSTLOGON
	 * @param isfirstlogon the ISFIRSTLOGON value
	 */
	public void setIsfirstlogon (java.lang.String isfirstlogon) {
		this.isfirstlogon = isfirstlogon;
	}



	/**
	 * Return the value associated with the column: CUSTOMERNO
	 */
	public com.eaoa.vo.pub.PubCustomer getCompany () {
		return company;
	}

	/**
	 * Set the value related to the column: CUSTOMERNO
	 * @param company the CUSTOMERNO value
	 */
	public void setCompany (com.eaoa.vo.pub.PubCustomer company) {
		this.company = company;
	}



	/**
	 * Return the value associated with the column: pubCustomers
	 */
	public java.util.Set<com.eaoa.vo.pub.PubCustomer> getPubCustomers () {
		return pubCustomers;
	}

	/**
	 * Set the value related to the column: pubCustomers
	 * @param pubCustomers the pubCustomers value
	 */
	public void setPubCustomers (java.util.Set<com.eaoa.vo.pub.PubCustomer> pubCustomers) {
		this.pubCustomers = pubCustomers;
	}

	public void addTopubCustomers (com.eaoa.vo.pub.PubCustomer pubCustomer) {
		if (null == getPubCustomers()) setPubCustomers(new java.util.TreeSet<com.eaoa.vo.pub.PubCustomer>());
		getPubCustomers().add(pubCustomer);
	}



	/**
	 * Return the value associated with the column: pubRoles
	 */
	public java.util.Set<com.eaoa.vo.pub.PubRole> getPubRoles () {
		return pubRoles;
	}

	/**
	 * Set the value related to the column: pubRoles
	 * @param pubRoles the pubRoles value
	 */
	public void setPubRoles (java.util.Set<com.eaoa.vo.pub.PubRole> pubRoles) {
		this.pubRoles = pubRoles;
	}

	public void addTopubRoles (com.eaoa.vo.pub.PubRole pubRole) {
		if (null == getPubRoles()) setPubRoles(new java.util.TreeSet<com.eaoa.vo.pub.PubRole>());
		getPubRoles().add(pubRole);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.eaoa.vo.pub.PubAccount)) return false;
		else {
			com.eaoa.vo.pub.PubAccount pubAccount = (com.eaoa.vo.pub.PubAccount) obj;
			if (null == this.getAccountno() || null == pubAccount.getAccountno()) return false;
			else return (this.getAccountno().equals(pubAccount.getAccountno()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getAccountno()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getAccountno().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}